// 2025.03.10 17:12 星期一 阴 因为 上个文件 有时候会卡顿 可能 管理 之中写错了许多 因此 重新写 一份
// 而且  采用 class 模式 进行 管理 可能后期 还会 进行分配 对具体功能进行 分匣制
import { createApp } from 'vue';
import './style.css';
import App from './App.vue';
import router from './router';
import special_key_world from './components/my_schedule/unitComps/special_key_world/special_key_world.vue';
import keyVal_node from './global/element/form_table/keyVal_node/keyVal_node.vue';
// import Select_node from './global/element/form_table/select_node/select_node.vue';
import Select_empty from './global/element/form_table/select_epmty/select_empty.vue';
import { direct_spacename_my_schedule } from './components/my_schedule/direct';
import { direct_spacename_global } from './global/direct';
import { toStringTypeCheck } from './global/Func/uniFunc/Func';
import { high_light_dom } from './global/element/high_light_dom';
// import Select_node from './global/element/form_table/select_node/select_node.vue';
import Select_node from './components/globalComps/comps/select_node/select_node.vue';
// import dayjs from 'dayjs';
window.high_light_dom = high_light_dom;
// 有一个 tips tippyjs 网站

// dayjs.locale('zh_cn');
let app = createApp(App).use(router);

use_direct([direct_spacename_my_schedule, direct_spacename_global]);

app
  .component('special_key_world', special_key_world)
  // .component('keyVal_node', keyVal_node)
  .component('select_node', Select_node)
  // .component('select_node', Select_node)
  .component('select_empty', Select_empty);

function use_direct(direct_spacename_obj_arr) {
  use_factory('directive', direct_spacename_obj_arr);
}

// function use_component(component_spacename_obj_arr) {
//   use_factory('component', component_spacename_obj_arr);
// }

/**
 *
 * @param {'directive' | 'component'} operate
 * @param {{}} operate_spacename_obj_arr
 */
function use_factory(operate, operate_spacename_obj_arr) {
  let uni_func = (operate_spacename_obj) => {
    for (const operate_name in operate_spacename_obj) {
      app[operate](operate_name, operate_spacename_obj[operate_name]);
    }
  };

  if (toStringTypeCheck(operate_spacename_obj_arr, 'object')) {
    operate_spacename_obj_arr = [operate_spacename_obj_arr];
  }

  for (const direct_spacename_obj of operate_spacename_obj_arr) {
    uni_func(direct_spacename_obj);
  }
}

app.mount('#app');
